package com.fastCms.business.frame.enums;

/**
 * 哈密瓜科技 版权所有 © Copyright 2019<br>
 *
 * @Description: 登录权限控制<br>
 * @Project: hami <br>
 * @CreateDate: Created in 2019/3/7 下午3:48 <br>
 * @Author: <a href="lsquan666@163.com">lsquan</a>
 */
public enum PlatformEnum {
    CMS("CMS", "CMS后台"),
    ADMIN("ADMIN", "超管后台");

    private String code;
    private String name;

    PlatformEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static PlatformEnum getEnum(String code) {
        for (PlatformEnum item : PlatformEnum.values()) {
            if (item.code == code) {
                return item;
            }
        }
        return null;
    }

    /**
     * 根据code获取name
     *
     * @param code
     * @return
     */
    public static String getName(String code) {
        PlatformEnum item = getEnum(code);
        return item != null ? item.name : null;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String key) {
        this.code = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


}
